package com.he.prototypemodel;

import com.he.prototypemodel.prorotype.EmpPrototype;
import com.he.prototypemodel.prorotype.WorkExperience;

public class Client {
    public static void main(String[] args) throws CloneNotSupportedException {
        //创建第一个emp
        WorkExperience workExperience = new WorkExperience("kingpig", 1.5d);
        EmpPrototype emp = new EmpPrototype(workExperience, "wayn", 22);
        //创建第二个emp
        EmpPrototype emp1 = (EmpPrototype) emp.clone();
        emp1.setName("tom");
        emp1.getWorkExperience().setWcompany("jrsoft");
        emp1.getWorkExperience().setWorkYear(1d);
        //创建第三个emp
        EmpPrototype emp2 = (EmpPrototype) emp.clone();
        emp2.setName("jam");
        emp2.getWorkExperience().setWcompany("ghxk");
        emp2.getWorkExperience().setWorkYear(0.5d);
        System.out.println(emp);
        System.out.println(emp1);
        System.out.println(emp2);
    }
}
